﻿//==============================================================================  
//Copyright (C) 2012-2015 9UN.ORG. All rights reserved. 
//GUID：ac81213b-6419-4c33-bc10-305bc2b67481
//CLR Version: 4.0.30319.18033
//Code Author：Kevin Wang
//Contact：Email(Admin@9un.org),QQ(265382 or 74344)
//Filename：IDocumentRender
//Namespace：RuanRang.Core
//Functions：IRender  
//Created by Kevin Wang at 2013/2/3 10:59:19 http://blog.9un.org
//============================================================================== 

using System;
using System.Drawing;
using System.Drawing.Imaging;

namespace RuanRang.Core
{
    public interface IDocumentRender
    {
        /// <summary>
        /// Occurs when [open completed].
        /// </summary>
        event EventHandler<EventArgs> OpenCompleted;

        /// <summary>
        /// Occurs when [get image completed].
        /// </summary>
        event EventHandler<EventArgs> GetImageCompleted;

        /// <summary>
        /// Occurs when [save completed].
        /// </summary>
        event EventHandler<EventArgs> SaveCompleted;

        /// <summary>
        /// Opens the specified file path.
        /// </summary>
        /// <param name="filePath">The file path.</param>
        void Open(string filePath);

        /// <summary>
        /// Opens the async.
        /// </summary>
        /// <param name="filePath">The file path.</param>
        void OpenAsync(string filePath);

        /// <summary>
        /// Gets the image.
        /// </summary>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="resolution">The resolution.</param>
        /// <returns>Bitmap.</returns>
        Image GetImage(int pageIndex, float resolution = 100);

        /// <summary>
        /// Gets the image async.
        /// </summary>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="resolution">The resolution.</param>
        void GetImageAsync(int pageIndex, float resolution = 100);

        /// <summary>
        /// Gets the image.
        /// </summary>
        /// <param name="resolution">The resolution.</param>
        /// <returns>Image[][].</returns>
        Image[] GetImage(float resolution = 100);

        /// <summary>
        /// Gets the image async.
        /// </summary>
        /// <param name="resolution">The resolution.</param>
        void GetImageAsync(float resolution = 100);

        /// <summary>
        /// Saves the specified save to folder.
        /// </summary>
        /// <param name="saveToFolder">The save to folder.</param>
        /// <param name="baseName">Name of the base.</param>
        /// <param name="waterImagePath">The water image path.</param>
        /// <param name="resolution">The resolution.</param>
        /// <param name="imageFormat">The image format.</param>
        void Save(string saveToFolder, string baseName, string waterImagePath = null, float resolution = 100,
                  ImageFormat imageFormat = null);

        /// <summary>
        /// Gets the image async.
        /// </summary>
        /// <param name="saveToFolder">The save to folder.</param>
        /// <param name="baseName">Name of the base.</param>
        /// <param name="waterImagePath">The water image path.</param>
        /// <param name="resolution">The resolution.</param>
        /// <param name="imageFormat">The image format.</param>
        void SaveAsync(string saveToFolder, string baseName, string waterImagePath = null, float resolution = 100,
                  ImageFormat imageFormat = null);
    }
}
